///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Jun 17 2015)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////

#include "noname.h"

///////////////////////////////////////////////////////////////////////////

main_frame::main_frame( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxFrame( parent, id, title, pos, size, style )
{
	this->SetSizeHints( wxDefaultSize, wxDefaultSize );
	this->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) );
	this->SetBackgroundColour( wxColour( 231, 253, 28 ) );
	
	wxGridBagSizer* power_stress_gbSizer;
	power_stress_gbSizer = new wxGridBagSizer( 0, 0 );
	power_stress_gbSizer->SetFlexibleDirection( wxBOTH );
	power_stress_gbSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
	
	test_name_panel = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxSize( 100,100 ), wxTAB_TRAVERSAL );
	test_name_panel->SetBackgroundColour( wxColour( 255, 255, 128 ) );
	
	wxBoxSizer* test_name_bsizer;
	test_name_bsizer = new wxBoxSizer( wxVERTICAL );
	
	test_name_label = new wxStaticText( test_name_panel, wxID_ANY, wxT("Power Stress Test"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE );
	test_name_label->Wrap( -1 );
	test_name_label->SetFont( wxFont( 28, 70, 90, 92, false, wxEmptyString ) );
	
	test_name_bsizer->Add( test_name_label, 0, wxALIGN_CENTER|wxALL, 10 );
	
	
	test_name_panel->SetSizer( test_name_bsizer );
	test_name_panel->Layout();
	power_stress_gbSizer->Add( test_name_panel, wxGBPosition( 0, 0 ), wxGBSpan( 0, 2 ), wxALIGN_CENTER|wxALIGN_CENTER_VERTICAL|wxEXPAND|wxLEFT|wxRIGHT, 5 );
	
	osc_panel = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxSize( 200,200 ), wxTAB_TRAVERSAL );
	osc_panel->SetBackgroundColour( wxColour( 5, 209, 169 ) );
	
	wxGridBagSizer* osc_gbSizer;
	osc_gbSizer = new wxGridBagSizer( 0, 0 );
	osc_gbSizer->SetFlexibleDirection( wxBOTH );
	osc_gbSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
	
	osc_ip_label = new wxStaticText( osc_panel, wxID_ANY, wxT("OSC IP"), wxDefaultPosition, wxDefaultSize, 0 );
	osc_ip_label->Wrap( -1 );
	osc_ip_label->SetFont( wxFont( 18, 70, 90, 90, false, wxEmptyString ) );
	osc_ip_label->SetMinSize( wxSize( 150,30 ) );
	
	osc_gbSizer->Add( osc_ip_label, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALL, 5 );
	
	osc_ip_text = new wxTextCtrl( osc_panel, wxID_ANY, wxT("172.22.8.202#"), wxDefaultPosition, wxDefaultSize, 0 );
	osc_ip_text->SetFont( wxFont( 12, 70, 90, 90, false, wxEmptyString ) );
	osc_ip_text->SetMinSize( wxSize( 150,22 ) );
	
	osc_gbSizer->Add( osc_ip_text, wxGBPosition( 0, 1 ), wxGBSpan( 1, 1 ), wxALL, 5 );
	
	osc_picture_path_label = new wxStaticText( osc_panel, wxID_ANY, wxT("Picture Path"), wxDefaultPosition, wxDefaultSize, 0 );
	osc_picture_path_label->Wrap( -1 );
	osc_picture_path_label->SetFont( wxFont( 18, 70, 90, 90, false, wxEmptyString ) );
	osc_picture_path_label->SetMinSize( wxSize( 150,30 ) );
	
	osc_gbSizer->Add( osc_picture_path_label, wxGBPosition( 0, 2 ), wxGBSpan( 1, 1 ), wxALL, 5 );
	
	osc_picture_path_text = new wxTextCtrl( osc_panel, wxID_ANY, wxT("C:\\ATE"), wxDefaultPosition, wxDefaultSize, wxTE_READONLY );
	osc_picture_path_text->SetFont( wxFont( 12, 70, 90, 90, false, wxEmptyString ) );
	osc_picture_path_text->SetMinSize( wxSize( 150,22 ) );
	
	osc_gbSizer->Add( osc_picture_path_text, wxGBPosition( 0, 3 ), wxGBSpan( 1, 1 ), wxALL, 5 );
	
	address_mode_label = new wxStaticText( osc_panel, wxID_ANY, wxT("Address Mode"), wxDefaultPosition, wxDefaultSize, 0 );
	address_mode_label->Wrap( -1 );
	address_mode_label->SetFont( wxFont( 18, 70, 90, 90, false, wxEmptyString ) );
	address_mode_label->SetMinSize( wxSize( 150,30 ) );
	
	osc_gbSizer->Add( address_mode_label, wxGBPosition( 1, 0 ), wxGBSpan( 1, 1 ), wxALL, 5 );
	
	address_mode_text = new wxTextCtrl( osc_panel, wxID_ANY, wxT("ADDr7"), wxDefaultPosition, wxDefaultSize, 0 );
	address_mode_text->SetFont( wxFont( 12, 70, 90, 90, false, wxEmptyString ) );
	address_mode_text->SetMinSize( wxSize( 150,22 ) );
	
	osc_gbSizer->Add( address_mode_text, wxGBPosition( 1, 1 ), wxGBSpan( 1, 1 ), wxALL, 5 );
	
	osc_voltage_mode_label = new wxStaticText( osc_panel, wxID_ANY, wxT("Voltage Mode"), wxDefaultPosition, wxDefaultSize, 0 );
	osc_voltage_mode_label->Wrap( -1 );
	osc_voltage_mode_label->SetFont( wxFont( 18, 70, 90, 90, false, wxEmptyString ) );
	osc_voltage_mode_label->SetMinSize( wxSize( 150,30 ) );
	
	osc_gbSizer->Add( osc_voltage_mode_label, wxGBPosition( 1, 2 ), wxGBSpan( 1, 1 ), wxALL, 5 );
	
	osc_voltage_mode_text = new wxTextCtrl( osc_panel, wxID_ANY, wxT("3"), wxDefaultPosition, wxDefaultSize, 0 );
	osc_voltage_mode_text->SetFont( wxFont( 12, 70, 90, 90, false, wxEmptyString ) );
	osc_voltage_mode_text->SetToolTip( wxT("Unit: v") );
	osc_voltage_mode_text->SetMinSize( wxSize( 150,22 ) );
	
	osc_gbSizer->Add( osc_voltage_mode_text, wxGBPosition( 1, 3 ), wxGBSpan( 1, 1 ), wxALL, 5 );
	
	
	osc_panel->SetSizer( osc_gbSizer );
	osc_panel->Layout();
	power_stress_gbSizer->Add( osc_panel, wxGBPosition( 1, 0 ), wxGBSpan( 1, 1 ), wxALL|wxEXPAND, 5 );
	
	excel_panel = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxSize( 200,200 ), wxTAB_TRAVERSAL );
	excel_panel->SetBackgroundColour( wxColour( 5, 209, 169 ) );
	
	wxGridBagSizer* excel_gbSizer;
	excel_gbSizer = new wxGridBagSizer( 0, 0 );
	excel_gbSizer->SetFlexibleDirection( wxBOTH );
	excel_gbSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
	
	excel_path_label = new wxStaticText( excel_panel, wxID_ANY, wxT("Excel Path"), wxDefaultPosition, wxDefaultSize, 0 );
	excel_path_label->Wrap( -1 );
	excel_path_label->SetFont( wxFont( 18, 70, 90, 90, false, wxEmptyString ) );
	excel_path_label->SetMinSize( wxSize( 150,30 ) );
	
	excel_gbSizer->Add( excel_path_label, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALL, 5 );
	
	excel_path_text = new wxTextCtrl( excel_panel, wxID_ANY, wxT("enter 键选择 excel"), wxDefaultPosition, wxDefaultSize, 0 );
	excel_path_text->SetFont( wxFont( 12, 70, 90, 90, false, wxEmptyString ) );
	excel_path_text->SetMinSize( wxSize( 150,22 ) );
	
	excel_gbSizer->Add( excel_path_text, wxGBPosition( 0, 1 ), wxGBSpan( 1, 1 ), wxALIGN_RIGHT|wxALL, 5 );
	
	excel_sheet_label = new wxStaticText( excel_panel, wxID_ANY, wxT("Excel Sheet"), wxDefaultPosition, wxSize( -1,-1 ), 0 );
	excel_sheet_label->Wrap( -1 );
	excel_sheet_label->SetFont( wxFont( 18, 70, 90, 90, false, wxEmptyString ) );
	excel_sheet_label->SetMinSize( wxSize( 150,30 ) );
	
	excel_gbSizer->Add( excel_sheet_label, wxGBPosition( 0, 2 ), wxGBSpan( 1, 1 ), wxALL, 5 );
	
	excel_sheet_text = new wxTextCtrl( excel_panel, wxID_ANY, wxT("4"), wxDefaultPosition, wxDefaultSize, 0 );
	excel_sheet_text->SetFont( wxFont( 12, 70, 90, 90, false, wxEmptyString ) );
	excel_sheet_text->SetMinSize( wxSize( 150,22 ) );
	
	excel_gbSizer->Add( excel_sheet_text, wxGBPosition( 0, 3 ), wxGBSpan( 1, 1 ), wxALL, 5 );
	
	test_row = new wxStaticText( excel_panel, wxID_ANY, wxT("Test Row"), wxDefaultPosition, wxDefaultSize, 0 );
	test_row->Wrap( -1 );
	test_row->SetFont( wxFont( 18, 70, 90, 90, false, wxEmptyString ) );
	test_row->SetMinSize( wxSize( 150,30 ) );
	
	excel_gbSizer->Add( test_row, wxGBPosition( 1, 0 ), wxGBSpan( 1, 1 ), wxALL, 5 );
	
	test_row_text = new wxTextCtrl( excel_panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
	test_row_text->SetFont( wxFont( 12, 70, 90, 90, false, wxEmptyString ) );
	test_row_text->SetToolTip( wxT("间隔的行用逗号 [ , ] 分隔每一个行号\n\n相邻的多行用分隔符 [ - ] 分隔\n\n例：3，5-10，22") );
	test_row_text->SetMinSize( wxSize( 150,22 ) );
	
	excel_gbSizer->Add( test_row_text, wxGBPosition( 1, 1 ), wxGBSpan( 1, 1 ), wxALL, 5 );
	
	start_column_label = new wxStaticText( excel_panel, wxID_ANY, wxT("Start Column"), wxDefaultPosition, wxDefaultSize, 0 );
	start_column_label->Wrap( -1 );
	start_column_label->SetFont( wxFont( 18, 70, 90, 90, false, wxEmptyString ) );
	start_column_label->SetMinSize( wxSize( 150,30 ) );
	
	excel_gbSizer->Add( start_column_label, wxGBPosition( 1, 2 ), wxGBSpan( 1, 1 ), wxALL, 5 );
	
	start_column_text = new wxTextCtrl( excel_panel, wxID_ANY, wxT("4"), wxDefaultPosition, wxDefaultSize, 0 );
	start_column_text->SetFont( wxFont( 12, 70, 90, 90, false, wxEmptyString ) );
	start_column_text->SetMinSize( wxSize( 150,22 ) );
	
	excel_gbSizer->Add( start_column_text, wxGBPosition( 1, 3 ), wxGBSpan( 1, 1 ), wxALL, 5 );
	
	picture_start_row_label = new wxStaticText( excel_panel, wxID_ANY, wxT("Picture Start Row"), wxDefaultPosition, wxDefaultSize, 0 );
	picture_start_row_label->Wrap( -1 );
	picture_start_row_label->SetFont( wxFont( 12, 70, 90, 90, false, wxEmptyString ) );
	picture_start_row_label->SetMinSize( wxSize( 150,22 ) );
	
	excel_gbSizer->Add( picture_start_row_label, wxGBPosition( 2, 0 ), wxGBSpan( 1, 1 ), wxALL, 5 );
	
	picture_start_row_text = new wxTextCtrl( excel_panel, wxID_ANY, wxT("1"), wxDefaultPosition, wxDefaultSize, 0 );
	picture_start_row_text->SetFont( wxFont( 12, 70, 90, 90, false, wxEmptyString ) );
	picture_start_row_text->SetMinSize( wxSize( 150,22 ) );
	
	excel_gbSizer->Add( picture_start_row_text, wxGBPosition( 2, 1 ), wxGBSpan( 1, 1 ), wxALL, 5 );
	
	specified_measures_label = new wxStaticText( excel_panel, wxID_ANY, wxT("Specified Measures"), wxDefaultPosition, wxDefaultSize, 0 );
	specified_measures_label->Wrap( -1 );
	specified_measures_label->SetFont( wxFont( 12, 70, 90, 90, false, wxEmptyString ) );
	specified_measures_label->SetMinSize( wxSize( 150,22 ) );
	
	excel_gbSizer->Add( specified_measures_label, wxGBPosition( 2, 2 ), wxGBSpan( 1, 1 ), wxALL, 5 );
	
	specified_measures_text = new wxTextCtrl( excel_panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
	specified_measures_text->SetFont( wxFont( 12, 70, 90, 90, false, wxEmptyString ) );
	specified_measures_text->SetToolTip( wxT("不填：Test Row的每一行所有measure都测试\n填写：只测试填写的measure，逗号分隔每一个measure") );
	specified_measures_text->SetMinSize( wxSize( 150,22 ) );
	
	excel_gbSizer->Add( specified_measures_text, wxGBPosition( 2, 3 ), wxGBSpan( 1, 1 ), wxALL, 5 );
	
	
	excel_panel->SetSizer( excel_gbSizer );
	excel_panel->Layout();
	power_stress_gbSizer->Add( excel_panel, wxGBPosition( 2, 0 ), wxGBSpan( 1, 1 ), wxEXPAND | wxALL, 5 );
	
	channels_panel = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
	channels_panel->SetBackgroundColour( wxColour( 5, 209, 169 ) );
	
	wxGridBagSizer* gbSizer4;
	gbSizer4 = new wxGridBagSizer( 0, 0 );
	gbSizer4->SetFlexibleDirection( wxBOTH );
	gbSizer4->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
	
	ch1_checkbox = new wxCheckBox( channels_panel, wxID_ANY, wxT("CH1"), wxDefaultPosition, wxDefaultSize, 0 );
	ch1_checkbox->SetValue(true); 
	ch1_checkbox->SetFont( wxFont( 18, 70, 90, 90, false, wxEmptyString ) );
	ch1_checkbox->SetBackgroundColour( wxColour( 5, 209, 169 ) );
	
	gbSizer4->Add( ch1_checkbox, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALL, 5 );
	
	ch2_checkbox = new wxCheckBox( channels_panel, wxID_ANY, wxT("CH2"), wxDefaultPosition, wxDefaultSize, 0 );
	ch2_checkbox->SetValue(true); 
	ch2_checkbox->SetFont( wxFont( 18, 70, 90, 90, false, wxEmptyString ) );
	ch2_checkbox->SetBackgroundColour( wxColour( 5, 209, 169 ) );
	
	gbSizer4->Add( ch2_checkbox, wxGBPosition( 0, 1 ), wxGBSpan( 1, 1 ), wxALL, 5 );
	
	ch3_checkbox = new wxCheckBox( channels_panel, wxID_ANY, wxT("CH3"), wxDefaultPosition, wxDefaultSize, 0 );
	ch3_checkbox->SetValue(true); 
	ch3_checkbox->SetFont( wxFont( 18, 70, 90, 90, false, wxEmptyString ) );
	ch3_checkbox->SetBackgroundColour( wxColour( 5, 209, 169 ) );
	
	gbSizer4->Add( ch3_checkbox, wxGBPosition( 0, 2 ), wxGBSpan( 1, 1 ), wxALL, 5 );
	
	ch4_checkbox = new wxCheckBox( channels_panel, wxID_ANY, wxT("CH4"), wxDefaultPosition, wxDefaultSize, 0 );
	ch4_checkbox->SetFont( wxFont( 18, 70, 90, 90, false, wxEmptyString ) );
	ch4_checkbox->SetBackgroundColour( wxColour( 5, 209, 169 ) );
	
	gbSizer4->Add( ch4_checkbox, wxGBPosition( 0, 3 ), wxGBSpan( 1, 1 ), wxALL, 5 );
	
	toggle_channels = new wxToggleButton( channels_panel, wxID_ANY, wxT("Toggle Channels"), wxDefaultPosition, wxDefaultSize, wxSIMPLE_BORDER );
	toggle_channels->SetBackgroundColour( wxColour( 255, 128, 0 ) );
	
	gbSizer4->Add( toggle_channels, wxGBPosition( 0, 4 ), wxGBSpan( 1, 1 ), wxLEFT, 50 );
	
	
	channels_panel->SetSizer( gbSizer4 );
	channels_panel->Layout();
	gbSizer4->Fit( channels_panel );
	power_stress_gbSizer->Add( channels_panel, wxGBPosition( 3, 0 ), wxGBSpan( 1, 1 ), wxEXPAND | wxALL, 5 );
	
	button_panel = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
	wxGridBagSizer* button_gbsizer;
	button_gbsizer = new wxGridBagSizer( 0, 0 );
	button_gbsizer->SetFlexibleDirection( wxBOTH );
	button_gbsizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
	
	Run_button = new wxButton( button_panel, wxID_ANY, wxT("Run"), wxDefaultPosition, wxSize( 120,70 ), wxBU_EXACTFIT );
	Run_button->SetFont( wxFont( 28, 70, 90, 92, false, wxEmptyString ) );
	Run_button->SetBackgroundColour( wxColour( 255, 0, 0 ) );
	
	button_gbsizer->Add( Run_button, wxGBPosition( 0, 20 ), wxGBSpan( 1, 2 ), wxALIGN_CENTER|wxALL, 30 );
	
	
	button_panel->SetSizer( button_gbsizer );
	button_panel->Layout();
	button_gbsizer->Fit( button_panel );
	power_stress_gbSizer->Add( button_panel, wxGBPosition( 4, 0 ), wxGBSpan( 1, 1 ), wxEXPAND | wxALL, 5 );
	
	
	this->SetSizer( power_stress_gbSizer );
	this->Layout();
	
	this->Centre( wxBOTH );
	
	// Connect Events
	excel_path_text->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( main_frame::GetExcelPath ), NULL, this );
	toggle_channels->Connect( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler( main_frame::ToggleChannels ), NULL, this );
}

main_frame::~main_frame()
{
	// Disconnect Events
	excel_path_text->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( main_frame::GetExcelPath ), NULL, this );
	toggle_channels->Disconnect( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler( main_frame::ToggleChannels ), NULL, this );
	
}
